package com.yang.paymentdemo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.spi.DocumentationType;

import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author yxc
 * @date 2022/1/19
 **/

@Configuration   //声明是配置类，使之加入bean
@EnableSwagger2  //开启swagger2注解
public class Swagger2Config {

    @Bean
    public Docket docket(){  //Docket是Swagger当中的文档对象
        //new ApiInfoBuilder().build()构建apiInfo，build()需要房子最后面
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(new ApiInfoBuilder()
                .title("微信支付案例接口文档").build());
    }

}
